package us.icitap.timsportal.entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the USERS_ROLE database table.
 * 
 */
@Embeddable
public class UserRolePK implements Serializable {


	/**
	 * 
	 */
	private static final long serialVersionUID = 5531179716911826969L;

	@Column(name="USER_ID")
	private int userId;

	@Column(name="ROLE_ID", length=50)
	private String roleId;

    public UserRolePK() {
    }
	public int getUserId() {
		return this.userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public String getRoleId() {
		return roleId;
	}
	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
		result = prime * result + userId;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof UserRolePK))
			return false;
		UserRolePK other = (UserRolePK) obj;
		if (roleId == null) {
			if (other.roleId != null)
				return false;
		} else if (!roleId.equals(other.roleId))
			return false;
		if (userId != other.userId)
			return false;
		return true;
	}

	

}